<template>
  <div>
    我是app
    <h2>{{ car }}</h2>
  </div>
  <button @click="isShowDemo = !isShowDemo">切换显示隐藏</button>
  <br />
  <br />
  <br />
  <hr />
  <Demo v-if="isShowDemo" />
</template>

<script>
import { ref, provide, reactive } from "vue";
import Demo from "./components/Demo.vue";
export default {
  name: "App",
  components: {
    Demo,
  },
  setup() {
    const car = reactive({
      name: "奔驰",
      price: "40万",
      color: "red",
    });

    const isShowDemo = ref(true);

    provide("car", car);

    return {
      isShowDemo,
      car,
    };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
